﻿/**
 * Category.java 1.0 2007-4-20 上午01:57:40,创建 by yangfan
 */


package org.in4j.bbs.model;

import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 *
 * @author yangfan
 * @version 1.0 2007-4-20 上午01:57:40,创建
 */
public class Category
{
	private Integer id;
	private String name;
	private int topicCount;
	private int postCount;
	private int newPostCount;
	private Set<Board> boards = new HashSet<Board>();

	public Set<Board> getBoards()
	{
		return boards;
	}
	public void addBoard(Board board)
	{
		board.setCategory(this);
		this.boards.add(board);
	}

	public void removeBoard(Board board)
	{
		board.setCategory(null);
		this.boards.remove(board);
	}
	public void setBoards(Set<Board> boards)
	{
		this.boards = boards;
	}
	public Integer getId()
	{
		return id;
	}
	public void setId(Integer id)
	{
		this.id = id;
	}
	public String getName()
	{
		return name;
	}
	public void setName(String name)
	{
		this.name = name;
	}
	public int getNewPostCount()
	{
		return newPostCount;
	}
	public void setNewPostCount(int newPostCount)
	{
		this.newPostCount = newPostCount;
	}
	public int getPostCount()
	{
		return postCount;
	}
	public void setPostCount(int postCount)
	{
		this.postCount = postCount;
	}
	public int getTopicCount()
	{
		return topicCount;
	}
	public void setTopicCount(int topicCount)
	{
		this.topicCount = topicCount;
	}

	@Override
	public String toString()
	{
		return new ToStringBuilder(this).append("id", id).append("name", name).toString();
	}


}
